<form name="frmModal" method="post" action="proc/admin/nilai.php">
<input type="hidden" value="nilai-add" name="proc" />
<h2 class="dialog_title"><span>Add Nilai</span></h2>
<div class="dialog_content">
<div style="border-bottom: 1px solid #CCC">
<table width="100%" border="0" cellpadding="5" cellspacing="0">
	<tr>
	  <td align="right">Nilai ID :</td>
	  <td><input name="nilai_id" type="text" maxlength="4" />
	    <!-- <input type="checkbox" name="rnp_id_generate" title="auto generate" 
				onchange="var fr = $(this).getParent('form'); 
							fr.rnp_id.set('disabled', this.checked).set('value', this.checked? 'auto generate' : '')"> --></td>
	  </tr>
	<tr>
	  <td width="35%" align="right">Tipe Pres/Pel </td>
	  <td><select name="achiev_jenis" id="achiev_jenis" onchange="doAdd_bidangCombo(this.value, $('achiev_bidang'))">
	    <option value="prestasi">Prestasi</option>
	    <option value="pelanggaran">Pelanggaran</option>
	    </select></td>
	  </tr>
	<tr>
	  <td align="right">Bidang Pres/Pel :</td>
	  <td><select id="achiev_bidang" onchange="doAdd_tingkatCombo($('achiev_jenis').value, this.value, $('detachiev_tingkat'))">
	    <?php $res = perpel_select2(false, "ACHIEV_JENIS='prestasi'", "ACHIEV_BIDANG ASC", "ACHIEV_BIDANG"); ?>
	    <?php while($row = mysql_fetch_assoc($res)): ?>
        <?php 	$bidang = !$bidang? $row['ACHIEV_BIDANG'] : $bidang ?>
	    <option value="<?php echo $row['ACHIEV_BIDANG']?>"><?php echo $row['ACHIEV_BIDANG']?></option>
	    <?php endwhile;?>
	    </select></td>
	  </tr>
	<tr>
	  <td align="right">Tingkat Pres/Pel : </td>
	  <td>
	    <select id="detachiev_tingkat" onchange="doAdd_kategoriCombo($('achiev_jenis').value, $('achiev_bidang').value, this.value, $('detachiev_id'))">
	      <?php $grp = deprepel_select_corelate(false, "a.ACHIEV_JENIS='prestasi' AND a.ACHIEV_BIDANG='$bidang'", "DETACHIEV_TINGKAT ASC", "DETACHIEV_TINGKAT");?>
	      <?php while ($grp_r = mysql_fetch_assoc($grp)): ?>
	      <?php $tingkat = !$tingkat? $grp_r['DETACHIEV_TINGKAT'] : $tingkat ?>
	      <option value="<?php echo $grp_r['DETACHIEV_TINGKAT']?>"><?php echo $grp_r['DETACHIEV_TINGKAT']?></option>
	      <?php endwhile; ?>
	      </select>
	    </td>
	  </tr>
	<tr>
	  <td align="right">Kategori Pres/Pel : </td>
	  <td>
      <select id="detachiev_id" name="detachiev_id">
      	<?php $grp = deprepel_select_corelate(false, "a.ACHIEV_JENIS='prestasi' AND a.ACHIEV_BIDANG='$bidang' AND DETACHIEV_TINGKAT='$tingkat'", "DETACHIEV_NAMA ASC", "DETACHIEV_NAMA"); ?>
	      <?php while ($grp_r = mysql_fetch_assoc($grp)): ?>
	      <option value="<?php echo $grp_r['DETACHIEV_ID']?>"><?php echo $grp_r['DETACHIEV_NAMA']?></option>
	      <?php endwhile; ?>
      </select></td>
	  </tr>
	<tr>
	  <td align="right">Tipe R/P  :</td>
	  <td><select id="reward_jenis" onchange="doAdd_rewardCombo(this.value, $('reward_id'))">
      		<option value="reward">Reward</option>
            <option value="punishment" disabled="disabled">Punishment</option>
          </select>
	    </td>
	  </tr>
	<tr>
	  <td align="right">Kategori R/P : </td>
	  <td>
      	<select name="reward_id" id="reward_id">
	      <?php $rnp = rnp_select2(false, "REWARD_JENIS='reward'", "REWARD_NAMA ASC"); ?>
	      <?php while ($row = mysql_fetch_assoc($rnp)):?>
	      <option value="<?php echo $row['REWARD_ID'] ?>"><?php echo $row['REWARD_NAMA'] ?></option>
	      <?php endwhile;?>
	    </select>
      </td>
	  </tr>
	<tr>
	  <td align="right">Point :</td>
	  <td><div id="nilai_point"></div></td>
	  </tr>
	<tr>
	  <td align="right">Range Min : </td>
	  <td align="left"><div id="nilai_min"></div></td>
	  </tr>
	<tr>
	  <td align="right">Range Max : </td>
	  <td align="left"><div id="nilai_max"></div></td>
	  </tr>
	</table>
</div>
<div class="dialog_buttons"><input type="button" value="Save"
	name="save" onclick="doSave($(this).getParent('form')); FBModal_hide()" />
<input type="button" value="Close" name="close" onclick="FBModal_hide()" />
</div>
</div>
</form>